<?php
	
	Session_Start();
	//
	$_UserAgent = $_SERVER["HTTP_USER_AGENT"]; 
	$_UserAgentSupport = 0;  /* _UserAgentSuppoert :  0 - Support perfect ;  1 - Not very well ; 2 - Not support */
	//
	Require_Once("config.php");
	//
	if(StriStr($_UserAgent,"MSIE"))
	{
		$_UserAgentSupport = 1;
	}elseif(StriStr($_UserAgent,"Chrome"))
	{
		$_UserAgentSupport = 2;
	}
	if($_SESSION["login"] == "logged") 
	{
		Header("Location:$URL" . "editor.php"); 
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login on BossEditor</title>
<link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p align="center">Welcome to Boss Editor<br /></p>

<div class="index_msg">
<?php
	if(!$_SESSION["login"])
	{
		echo '<p align="center">Enter Password to login</p>' . "\r" ;
	}
	elseif($_SESSION["login"] == "password_none") 
	{
		echo '<p align="center" class="error_text">Please enter the Password</p>' . "\r" ;
	}
	elseif($_SESSION["login"] == "password_error") 
	{
		echo '<p align="center" class="error_text">Please check your Password</p>' . "\r" ;
	}
	elseif($_SESSION["login"] == "logout") 
	{
		echo '<p align="center">Logout Successed</p>' . "\r" ;
		Session_Destroy();
	}
	
?>
<form id="login_form" name="login_form" method="post" action="login.php">
	<div align="center">
	<input type="password" name="password_input_form" tabindex="1" />
	<br />
	<br />
	<label>
	<input type="submit" name="Submit" value="Login" tabindex="2" />
	</label>
	</div>
</form>
</div>
<p align="right">
The last update: 2008/8/26<br />
Author: <a href="http://www.w3rep.cn/blog/?page_id=2" target="_blank">Francis</a> <a href="http://harryxu.cn/blog/about" target="_blank">Harry</a><br /> 
<img src="images/w3c_xhtml.png" alt="XHTML Valid" />
<img src="images/w3c_css.png" alt="Css Valid" />
</p>

<div id="UASupport">
<?php

switch ($_UserAgentSupport)
{
	case 1:
		echo "Recommend to use [Firefox 3] to get the best performance!";
		break;
	case 2:
		echo "Sorry,Your browser was not be supported.<br />";
		echo "We will update soon.";
		break;
}

?>
</div>
</body>
</html>
